#define dosFIX_MPY(DEST,A,B){_DX = (B);_AX = (A);asm imul dx;asm add ax,ax;asm adc dx,dx;DEST = _DX;}

		
/* FIX_MPY() - fixed-point multiplication macro.
   This macro is a statement, not an expression (uses asm).
   BEWARE: make sure _DX is not clobbered by evaluating (A) or DEST.
   args are all of type fixed.
   Scaling ensures that 32767*32767 = 32767. */
#define FIX_MPY(DEST,A,B)       DEST = ((long)(A) * (long)(B))>>15

#define N_WAVE          1024    /* dimension of Sinewave[] */
#define LOG2_N_WAVE     10      /* log2(N_WAVE) */
#define N_LOUD          100     /* dimension of Loudampl[] */
#ifndef fixed
#define fixed short
#endif

int db_from_ampl(fixed re, fixed im);

fixed fix_mpy(fixed a, fixed b);

int fix_fft(fixed fr[], fixed fi[], int m, int inverse);

void window(fixed fr[], int n);

void fix_loud(fixed loud[], fixed fr[], fixed fi[], int n, int scale_shift);

int db_from_ampl(fixed re, fixed im);

fixed fix_mpy(fixed a, fixed b);

int iscale(int value, int numer, int denom);

fixed fix_dot(fixed *hpa, fixed *pb, int n);
